package com.github.prontera.common.auth0.jwt.algorithms;

import com.github.prontera.common.auth0.jwt.exceptions.SignatureGenerationException;
import com.github.prontera.common.auth0.jwt.exceptions.SignatureVerificationException;

class NoneAlgorithm extends Algorithm {

	NoneAlgorithm() {
		super("none", "none");
	}

	@Override
	public void verify(byte[] contentBytes, byte[] signatureBytes) throws SignatureVerificationException {
		if (signatureBytes.length > 0) {
			throw new SignatureVerificationException(this);
		}
	}

	@Override
	public byte[] sign(byte[] contentBytes) throws SignatureGenerationException {
		return new byte[0];
	}
}
